// 2010-03-17 - M. Caputo

#include "CPolygon.h"

CPolygon::CPolygon()
{
	colored = false;
}

CPolygon::CPolygon(const QColor & color)
{
	colored = true;
	objectColor = color;
}

void CPolygon::addVertex(const CVertex & v)
{
	vertices.append(v);
}

int CPolygon::verticesCount() const
{
	return vertices.size();
}

const CVertex & CPolygon::vertex(int i) const
{
	return vertices[i];
}

void CPolygon::addColor(const QColor & color)
{
	colored = true;
	objectColor = color;
}

bool CPolygon::hasColor() const
{
	return colored;
}

const QColor & CPolygon::color() const
{
	return objectColor;
}
